function* oneAndDone() {
  yield 1;
  return "ok";
}
for (const v of oneAndDone()) console.log(v); // 1
console.log([...oneAndDone()]); // [1]
